package com.shj.em.biz.hr.mapper;

import com.shj.em.biz.hr.entity.Dept;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 部门信息 Mapper 接口
 * </p>
 *
 * @author Shen Huang Jian
 * @since 2018-07-04
 */
@Mapper
public interface DeptMapper extends BaseMapper<Dept> {
    /**
     * 分页查询
     * @param page 分页信息
     * @return
     */
    List<Dept> queryDeptPage(Page<Dept> page, Map<String, Object> params);

    Integer getDeptByName(@Param("deptName") String deptName, @Param("selfId") Long selfId);

    List<Dept> getChildDepts(Long id);

    /**
     * 应该只会有一条记录
     * @param empId
     * @return dept
     */
    Dept findDeptByEmpId(Long empId);

    /**
     * 找到所有生产二组及其工时权重
     * @return
     */
    List<Dept> findProdGrpTwoWithEffortWeight(@Param("effortWeight") String effortWeight);
}
